Skip to content

Commit fac481b

Browse files
stainless-app[bot]stainless-bot
authored andcommittedNov 21, 2024·
feat(api): api update (#3658)
1 parent 1e60c75 commit fac481b

5 files changed

+2
-225
lines changed
 

‎.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 1451
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-811ce6b3fb37e41c31b89ac40edb0f29791c03499a00e728955e3a317e664d82.yml
1+
configured_endpoints: 1449
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-65fb65b2114a872dda4e29b09cb0b33ea5fa3060819757a6c7a93bcc1a3a3422.yml

‎api.md

-6
Original file line numberDiff line numberDiff line change
@@ -4531,7 +4531,6 @@ Methods:
45314531

45324532
Params Types:
45334533

4534-
- <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>
45354534
- <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>
45364535
- <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>
45374536
- <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>
@@ -4578,11 +4577,6 @@ Methods:
45784577

45794578
##### Certificates
45804579

4581-
Methods:
4582-
4583-
- <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>
4584-
- <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>
4585-
45864580
#### Custom
45874581

45884582
Methods:

‎zero_trust/devicepolicy.go

-10
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ func NewDevicePolicyService(opts ...option.RequestOption) (r *DevicePolicyServic
3131
return
3232
}
3333

34-
type DevicePolicyCertificatesParam struct {
35-
// The current status of the device policy certificate provisioning feature for
36-
// WARP clients.
37-
Enabled param.Field[bool] `json:"enabled,required"`
38-
}
39-
40-
func (r DevicePolicyCertificatesParam) MarshalJSON() (data []byte, err error) {
41-
return apijson.MarshalRoot(r)
42-
}
43-
4434
type FallbackDomain struct {
4535
// The domain suffix to match when resolving locally.
4636
Suffix string `json:"suffix,required"`

‎zero_trust/devicepolicydefaultcertificate.go

-138
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,7 @@
33
package zero_trust
44

55
import (
6-
"context"
7-
"errors"
8-
"fmt"
9-
"net/http"
10-
11-
"github.com/cloudflare/cloudflare-go/v3/internal/apijson"
12-
"github.com/cloudflare/cloudflare-go/v3/internal/requestconfig"
136
"github.com/cloudflare/cloudflare-go/v3/option"
14-
"github.com/cloudflare/cloudflare-go/v3/shared"
157
)
168

179
// DevicePolicyDefaultCertificateService contains methods and other services that
@@ -32,133 +24,3 @@ func NewDevicePolicyDefaultCertificateService(opts ...option.RequestOption) (r *
3224
r.Options = opts
3325
return
3426
}
35-
36-
// Enable Zero Trust Clients to provision a certificate, containing a x509 subject,
37-
// and referenced by Access device posture policies when the client visits MTLS
38-
// protected domains. This facilitates device posture without a WARP session.
39-
func (r *DevicePolicyDefaultCertificateService) Edit(ctx context.Context, zoneTag string, body DevicePolicyDefaultCertificateEditParams, opts ...option.RequestOption) (res *interface{}, err error) {
40-
var env DevicePolicyDefaultCertificateEditResponseEnvelope
41-
opts = append(r.Options[:], opts...)
42-
if zoneTag == "" {
43-
err = errors.New("missing required zone_tag parameter")
44-
return
45-
}
46-
path := fmt.Sprintf("zones/%s/devices/policy/certificates", zoneTag)
47-
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &env, opts...)
48-
if err != nil {
49-
return
50-
}
51-
res = &env.Result
52-
return
53-
}
54-
55-
// Fetches device certificate provisioning
56-
func (r *DevicePolicyDefaultCertificateService) Get(ctx context.Context, zoneTag string, opts ...option.RequestOption) (res *interface{}, err error) {
57-
var env DevicePolicyDefaultCertificateGetResponseEnvelope
58-
opts = append(r.Options[:], opts...)
59-
if zoneTag == "" {
60-
err = errors.New("missing required zone_tag parameter")
61-
return
62-
}
63-
path := fmt.Sprintf("zones/%s/devices/policy/certificates", zoneTag)
64-
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
65-
if err != nil {
66-
return
67-
}
68-
res = &env.Result
69-
return
70-
}
71-
72-
type DevicePolicyDefaultCertificateEditParams struct {
73-
DevicePolicyCertificates DevicePolicyCertificatesParam `json:"device_policy_certificates,required"`
74-
}
75-
76-
func (r DevicePolicyDefaultCertificateEditParams) MarshalJSON() (data []byte, err error) {
77-
return apijson.MarshalRoot(r.DevicePolicyCertificates)
78-
}
79-
80-
type DevicePolicyDefaultCertificateEditResponseEnvelope struct {
81-
Errors []shared.ResponseInfo `json:"errors,required"`
82-
Messages []shared.ResponseInfo `json:"messages,required"`
83-
Result interface{} `json:"result,required"`
84-
// Whether the API call was successful.
85-
Success DevicePolicyDefaultCertificateEditResponseEnvelopeSuccess `json:"success,required"`
86-
JSON devicePolicyDefaultCertificateEditResponseEnvelopeJSON `json:"-"`
87-
}
88-
89-
// devicePolicyDefaultCertificateEditResponseEnvelopeJSON contains the JSON
90-
// metadata for the struct [DevicePolicyDefaultCertificateEditResponseEnvelope]
91-
type devicePolicyDefaultCertificateEditResponseEnvelopeJSON struct {
92-
Errors apijson.Field
93-
Messages apijson.Field
94-
Result apijson.Field
95-
Success apijson.Field
96-
raw string
97-
ExtraFields map[string]apijson.Field
98-
}
99-
100-
func (r *DevicePolicyDefaultCertificateEditResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
101-
return apijson.UnmarshalRoot(data, r)
102-
}
103-
104-
func (r devicePolicyDefaultCertificateEditResponseEnvelopeJSON) RawJSON() string {
105-
return r.raw
106-
}
107-
108-
// Whether the API call was successful.
109-
type DevicePolicyDefaultCertificateEditResponseEnvelopeSuccess bool
110-
111-
const (
112-
DevicePolicyDefaultCertificateEditResponseEnvelopeSuccessTrue DevicePolicyDefaultCertificateEditResponseEnvelopeSuccess = true
113-
)
114-
115-
func (r DevicePolicyDefaultCertificateEditResponseEnvelopeSuccess) IsKnown() bool {
116-
switch r {
117-
case DevicePolicyDefaultCertificateEditResponseEnvelopeSuccessTrue:
118-
return true
119-
}
120-
return false
121-
}
122-
123-
type DevicePolicyDefaultCertificateGetResponseEnvelope struct {
124-
Errors []shared.ResponseInfo `json:"errors,required"`
125-
Messages []shared.ResponseInfo `json:"messages,required"`
126-
Result interface{} `json:"result,required"`
127-
// Whether the API call was successful.
128-
Success DevicePolicyDefaultCertificateGetResponseEnvelopeSuccess `json:"success,required"`
129-
JSON devicePolicyDefaultCertificateGetResponseEnvelopeJSON `json:"-"`
130-
}
131-
132-
// devicePolicyDefaultCertificateGetResponseEnvelopeJSON contains the JSON metadata
133-
// for the struct [DevicePolicyDefaultCertificateGetResponseEnvelope]
134-
type devicePolicyDefaultCertificateGetResponseEnvelopeJSON struct {
135-
Errors apijson.Field
136-
Messages apijson.Field
137-
Result apijson.Field
138-
Success apijson.Field
139-
raw string
140-
ExtraFields map[string]apijson.Field
141-
}
142-
143-
func (r *DevicePolicyDefaultCertificateGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
144-
return apijson.UnmarshalRoot(data, r)
145-
}
146-
147-
func (r devicePolicyDefaultCertificateGetResponseEnvelopeJSON) RawJSON() string {
148-
return r.raw
149-
}
150-
151-
// Whether the API call was successful.
152-
type DevicePolicyDefaultCertificateGetResponseEnvelopeSuccess bool
153-
154-
const (
155-
DevicePolicyDefaultCertificateGetResponseEnvelopeSuccessTrue DevicePolicyDefaultCertificateGetResponseEnvelopeSuccess = true
156-
)
157-
158-
func (r DevicePolicyDefaultCertificateGetResponseEnvelopeSuccess) IsKnown() bool {
159-
switch r {
160-
case DevicePolicyDefaultCertificateGetResponseEnvelopeSuccessTrue:
161-
return true
162-
}
163-
return false
164-
}

‎zero_trust/devicepolicydefaultcertificate_test.go

-69
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.