Skip to content

Commit

Permalink
feat: generated
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Feb 5, 2024
1 parent 4c3d24f commit f5d9f30
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 253 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 113
configured_endpoints: 111
10 changes: 0 additions & 10 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,6 @@ Methods:

## Dnssecs

Response Types:

- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneDnssecGetResponse">ZoneDnssecGetResponse</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneDnssecUpdateResponse">ZoneDnssecUpdateResponse</a>

Methods:

- <code title="get /zones/{zone_identifier}/dnssec">client.Zones.Dnssecs.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneDnssecService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, zoneIdentifier <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneDnssecGetResponse">ZoneDnssecGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="patch /zones/{zone_identifier}/dnssec">client.Zones.Dnssecs.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneDnssecService.Update">Update</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, zoneIdentifier <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneDnssecUpdateParams">ZoneDnssecUpdateParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#ZoneDnssecUpdateResponse">ZoneDnssecUpdateResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

## RateLimits

Response Types:
Expand Down
2 changes: 0 additions & 2 deletions internal/shared/union.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ func (UnionString) ImplementsZoneLoadBalancerGetResponseResult() {}
func (UnionString) ImplementsZoneLoadBalancerUpdateResponseResult() {}
func (UnionString) ImplementsZoneLoadBalancerListResponseResult() {}
func (UnionString) ImplementsZoneLoadBalancerDeleteResponseResult() {}
func (UnionString) ImplementsZoneDnssecGetResponseResult() {}
func (UnionString) ImplementsZoneDnssecUpdateResponseResult() {}
240 changes: 0 additions & 240 deletions zonednssec.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,7 @@
package cloudflare

import (
"context"
"fmt"
"net/http"
"reflect"

"github.com/cloudflare/cloudflare-sdk-go/internal/apijson"
"github.com/cloudflare/cloudflare-sdk-go/internal/param"
"github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig"
"github.com/cloudflare/cloudflare-sdk-go/internal/shared"
"github.com/cloudflare/cloudflare-sdk-go/option"
"github.com/tidwall/gjson"
)

// ZoneDnssecService contains methods and other services that help with interacting
Expand All @@ -32,233 +22,3 @@ func NewZoneDnssecService(opts ...option.RequestOption) (r *ZoneDnssecService) {
r.Options = opts
return
}

// Details about DNSSEC status and configuration.
func (r *ZoneDnssecService) Get(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *ZoneDnssecGetResponse, err error) {
opts = append(r.Options[:], opts...)
path := fmt.Sprintf("zones/%s/dnssec", zoneIdentifier)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
return
}

// Enable or disable DNSSEC.
func (r *ZoneDnssecService) Update(ctx context.Context, zoneIdentifier string, body ZoneDnssecUpdateParams, opts ...option.RequestOption) (res *ZoneDnssecUpdateResponse, err error) {
opts = append(r.Options[:], opts...)
path := fmt.Sprintf("zones/%s/dnssec", zoneIdentifier)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &res, opts...)
return
}

type ZoneDnssecGetResponse struct {
Errors []ZoneDnssecGetResponseError `json:"errors,required"`
Messages []ZoneDnssecGetResponseMessage `json:"messages,required"`
Result ZoneDnssecGetResponseResult `json:"result,required"`
// Whether the API call was successful
Success ZoneDnssecGetResponseSuccess `json:"success,required"`
JSON zoneDnssecGetResponseJSON `json:"-"`
}

// zoneDnssecGetResponseJSON contains the JSON metadata for the struct
// [ZoneDnssecGetResponse]
type zoneDnssecGetResponseJSON struct {
Errors apijson.Field
Messages apijson.Field
Result apijson.Field
Success apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

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

type ZoneDnssecGetResponseError struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON zoneDnssecGetResponseErrorJSON `json:"-"`
}

// zoneDnssecGetResponseErrorJSON contains the JSON metadata for the struct
// [ZoneDnssecGetResponseError]
type zoneDnssecGetResponseErrorJSON struct {
Code apijson.Field
Message apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

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

type ZoneDnssecGetResponseMessage struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON zoneDnssecGetResponseMessageJSON `json:"-"`
}

// zoneDnssecGetResponseMessageJSON contains the JSON metadata for the struct
// [ZoneDnssecGetResponseMessage]
type zoneDnssecGetResponseMessageJSON struct {
Code apijson.Field
Message apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

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

// Union satisfied by [ZoneDnssecGetResponseResultUnknown],
// [ZoneDnssecGetResponseResultArray] or [shared.UnionString].
type ZoneDnssecGetResponseResult interface {
ImplementsZoneDnssecGetResponseResult()
}

func init() {
apijson.RegisterUnion(
reflect.TypeOf((*ZoneDnssecGetResponseResult)(nil)).Elem(),
"",
apijson.UnionVariant{
TypeFilter: gjson.String,
Type: reflect.TypeOf(shared.UnionString("")),
},
)
}

type ZoneDnssecGetResponseResultArray []interface{}

func (r ZoneDnssecGetResponseResultArray) ImplementsZoneDnssecGetResponseResult() {}

// Whether the API call was successful
type ZoneDnssecGetResponseSuccess bool

const (
ZoneDnssecGetResponseSuccessTrue ZoneDnssecGetResponseSuccess = true
)

type ZoneDnssecUpdateResponse struct {
Errors []ZoneDnssecUpdateResponseError `json:"errors,required"`
Messages []ZoneDnssecUpdateResponseMessage `json:"messages,required"`
Result ZoneDnssecUpdateResponseResult `json:"result,required"`
// Whether the API call was successful
Success ZoneDnssecUpdateResponseSuccess `json:"success,required"`
JSON zoneDnssecUpdateResponseJSON `json:"-"`
}

// zoneDnssecUpdateResponseJSON contains the JSON metadata for the struct
// [ZoneDnssecUpdateResponse]
type zoneDnssecUpdateResponseJSON struct {
Errors apijson.Field
Messages apijson.Field
Result apijson.Field
Success apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

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

type ZoneDnssecUpdateResponseError struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON zoneDnssecUpdateResponseErrorJSON `json:"-"`
}

// zoneDnssecUpdateResponseErrorJSON contains the JSON metadata for the struct
// [ZoneDnssecUpdateResponseError]
type zoneDnssecUpdateResponseErrorJSON struct {
Code apijson.Field
Message apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

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

type ZoneDnssecUpdateResponseMessage struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON zoneDnssecUpdateResponseMessageJSON `json:"-"`
}

// zoneDnssecUpdateResponseMessageJSON contains the JSON metadata for the struct
// [ZoneDnssecUpdateResponseMessage]
type zoneDnssecUpdateResponseMessageJSON struct {
Code apijson.Field
Message apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

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

// Union satisfied by [ZoneDnssecUpdateResponseResultUnknown],
// [ZoneDnssecUpdateResponseResultArray] or [shared.UnionString].
type ZoneDnssecUpdateResponseResult interface {
ImplementsZoneDnssecUpdateResponseResult()
}

func init() {
apijson.RegisterUnion(
reflect.TypeOf((*ZoneDnssecUpdateResponseResult)(nil)).Elem(),
"",
apijson.UnionVariant{
TypeFilter: gjson.String,
Type: reflect.TypeOf(shared.UnionString("")),
},
)
}

type ZoneDnssecUpdateResponseResultArray []interface{}

func (r ZoneDnssecUpdateResponseResultArray) ImplementsZoneDnssecUpdateResponseResult() {}

// Whether the API call was successful
type ZoneDnssecUpdateResponseSuccess bool

const (
ZoneDnssecUpdateResponseSuccessTrue ZoneDnssecUpdateResponseSuccess = true
)

type ZoneDnssecUpdateParams struct {
// 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 param.Field[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 param.Field[bool] `json:"dnssec_presigned"`
// Status of DNSSEC, based on user-desired state and presence of necessary records.
Status param.Field[ZoneDnssecUpdateParamsStatus] `json:"status"`
}

func (r ZoneDnssecUpdateParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}

// Status of DNSSEC, based on user-desired state and presence of necessary records.
type ZoneDnssecUpdateParamsStatus string

const (
ZoneDnssecUpdateParamsStatusActive ZoneDnssecUpdateParamsStatus = "active"
ZoneDnssecUpdateParamsStatusDisabled ZoneDnssecUpdateParamsStatus = "disabled"
)

0 comments on commit f5d9f30

Please sign in to comment.