Skip to content

Commit

Permalink
feat(api): api update (#3658)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Nov 21, 2024
1 parent 1e60c75 commit fac481b
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 225 deletions.
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1451
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-811ce6b3fb37e41c31b89ac40edb0f29791c03499a00e728955e3a317e664d82.yml
configured_endpoints: 1449
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-65fb65b2114a872dda4e29b09cb0b33ea5fa3060819757a6c7a93bcc1a3a3422.yml
6 changes: 0 additions & 6 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4531,7 +4531,6 @@ Methods:

Params Types:

- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#DevicePolicyCertificatesParam">DevicePolicyCertificatesParam</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#FallbackDomainParam">FallbackDomainParam</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#SplitTunnelExcludeParam">SplitTunnelExcludeParam</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#SplitTunnelIncludeParam">SplitTunnelIncludeParam</a>
Expand Down Expand Up @@ -4578,11 +4577,6 @@ Methods:

##### Certificates

Methods:

- <code title="patch /zones/{zone_tag}/devices/policy/certificates">client.ZeroTrust.Devices.Policies.Default.Certificates.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#DevicePolicyDefaultCertificateService.Edit">Edit</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, zoneTag <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#DevicePolicyDefaultCertificateEditParams">DevicePolicyDefaultCertificateEditParams</a>) (interface{}, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /zones/{zone_tag}/devices/policy/certificates">client.ZeroTrust.Devices.Policies.Default.Certificates.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#DevicePolicyDefaultCertificateService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, zoneTag <a href="https://pkg.go.dev/builtin#string">string</a>) (interface{}, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

#### Custom

Methods:
Expand Down
10 changes: 0 additions & 10 deletions zero_trust/devicepolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,6 @@ func NewDevicePolicyService(opts ...option.RequestOption) (r *DevicePolicyServic
return
}

type DevicePolicyCertificatesParam struct {
// The current status of the device policy certificate provisioning feature for
// WARP clients.
Enabled param.Field[bool] `json:"enabled,required"`
}

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

type FallbackDomain struct {
// The domain suffix to match when resolving locally.
Suffix string `json:"suffix,required"`
Expand Down
138 changes: 0 additions & 138 deletions zero_trust/devicepolicydefaultcertificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,7 @@
package zero_trust

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

"github.com/cloudflare/cloudflare-go/v3/internal/apijson"
"github.com/cloudflare/cloudflare-go/v3/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v3/option"
"github.com/cloudflare/cloudflare-go/v3/shared"
)

// DevicePolicyDefaultCertificateService contains methods and other services that
Expand All @@ -32,133 +24,3 @@ func NewDevicePolicyDefaultCertificateService(opts ...option.RequestOption) (r *
r.Options = opts
return
}

// Enable Zero Trust Clients to provision a certificate, containing a x509 subject,
// and referenced by Access device posture policies when the client visits MTLS
// protected domains. This facilitates device posture without a WARP session.
func (r *DevicePolicyDefaultCertificateService) Edit(ctx context.Context, zoneTag string, body DevicePolicyDefaultCertificateEditParams, opts ...option.RequestOption) (res *interface{}, err error) {
var env DevicePolicyDefaultCertificateEditResponseEnvelope
opts = append(r.Options[:], opts...)
if zoneTag == "" {
err = errors.New("missing required zone_tag parameter")
return
}
path := fmt.Sprintf("zones/%s/devices/policy/certificates", zoneTag)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}

// Fetches device certificate provisioning
func (r *DevicePolicyDefaultCertificateService) Get(ctx context.Context, zoneTag string, opts ...option.RequestOption) (res *interface{}, err error) {
var env DevicePolicyDefaultCertificateGetResponseEnvelope
opts = append(r.Options[:], opts...)
if zoneTag == "" {
err = errors.New("missing required zone_tag parameter")
return
}
path := fmt.Sprintf("zones/%s/devices/policy/certificates", zoneTag)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}

type DevicePolicyDefaultCertificateEditParams struct {
DevicePolicyCertificates DevicePolicyCertificatesParam `json:"device_policy_certificates,required"`
}

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

type DevicePolicyDefaultCertificateEditResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result interface{} `json:"result,required"`
// Whether the API call was successful.
Success DevicePolicyDefaultCertificateEditResponseEnvelopeSuccess `json:"success,required"`
JSON devicePolicyDefaultCertificateEditResponseEnvelopeJSON `json:"-"`
}

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

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

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

// Whether the API call was successful.
type DevicePolicyDefaultCertificateEditResponseEnvelopeSuccess bool

const (
DevicePolicyDefaultCertificateEditResponseEnvelopeSuccessTrue DevicePolicyDefaultCertificateEditResponseEnvelopeSuccess = true
)

func (r DevicePolicyDefaultCertificateEditResponseEnvelopeSuccess) IsKnown() bool {
switch r {
case DevicePolicyDefaultCertificateEditResponseEnvelopeSuccessTrue:
return true
}
return false
}

type DevicePolicyDefaultCertificateGetResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result interface{} `json:"result,required"`
// Whether the API call was successful.
Success DevicePolicyDefaultCertificateGetResponseEnvelopeSuccess `json:"success,required"`
JSON devicePolicyDefaultCertificateGetResponseEnvelopeJSON `json:"-"`
}

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

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

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

// Whether the API call was successful.
type DevicePolicyDefaultCertificateGetResponseEnvelopeSuccess bool

const (
DevicePolicyDefaultCertificateGetResponseEnvelopeSuccessTrue DevicePolicyDefaultCertificateGetResponseEnvelopeSuccess = true
)

func (r DevicePolicyDefaultCertificateGetResponseEnvelopeSuccess) IsKnown() bool {
switch r {
case DevicePolicyDefaultCertificateGetResponseEnvelopeSuccessTrue:
return true
}
return false
}
69 changes: 0 additions & 69 deletions zero_trust/devicepolicydefaultcertificate_test.go

This file was deleted.

0 comments on commit fac481b

Please sign in to comment.