Skip to content

Commit

Permalink
feat: OpenAPI spec update
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Feb 8, 2024
1 parent 7aeaf06 commit a4988d1
Show file tree
Hide file tree
Showing 149 changed files with 13,470 additions and 9,203 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 354
configured_endpoints: 337
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ package main
import (
"context"
"fmt"

"github.com/cloudflare/cloudflare-sdk-go"
"github.com/cloudflare/cloudflare-sdk-go/option"
)
Expand Down
298 changes: 194 additions & 104 deletions accessapp.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions accessapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ func TestAccessAppUpdateWithOptionalParams(t *testing.T) {
"023e105f4ecef8ad9ca31a8372d0c353",
shared.UnionString("023e105f4ecef8ad9ca31a8372d0c353"),
cloudflare.AccessAppUpdateParamsVariant0{
Domain: cloudflare.F("test.example.com/admin"),
Type: cloudflare.F("self_hosted"),
AllowAuthenticateViaWarp: cloudflare.F(true),
AllowedIdps: cloudflare.F([]string{"699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252"}),
AppLauncherVisible: cloudflare.F(true),
Expand All @@ -85,7 +87,6 @@ func TestAccessAppUpdateWithOptionalParams(t *testing.T) {
CustomDenyURL: cloudflare.F("string"),
CustomNonIdentityDenyURL: cloudflare.F("string"),
CustomPages: cloudflare.F([]string{"699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252"}),
Domain: cloudflare.F("test.example.com/admin"),
EnableBindingCookie: cloudflare.F(true),
HTTPOnlyCookieAttribute: cloudflare.F(true),
LogoURL: cloudflare.F("https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg"),
Expand All @@ -97,7 +98,6 @@ func TestAccessAppUpdateWithOptionalParams(t *testing.T) {
SessionDuration: cloudflare.F("24h"),
SkipInterstitial: cloudflare.F(true),
Tags: cloudflare.F([]string{"engineers", "engineers", "engineers"}),
Type: cloudflare.F("self_hosted"),
},
)
if err != nil {
Expand Down Expand Up @@ -161,6 +161,8 @@ func TestAccessAppAccessApplicationsAddAnApplicationWithOptionalParams(t *testin
"string",
"023e105f4ecef8ad9ca31a8372d0c353",
cloudflare.AccessAppAccessApplicationsAddAnApplicationParamsVariant0{
Domain: cloudflare.F("test.example.com/admin"),
Type: cloudflare.F("self_hosted"),
AllowAuthenticateViaWarp: cloudflare.F(true),
AllowedIdps: cloudflare.F([]string{"699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252"}),
AppLauncherVisible: cloudflare.F(true),
Expand All @@ -179,7 +181,6 @@ func TestAccessAppAccessApplicationsAddAnApplicationWithOptionalParams(t *testin
CustomDenyURL: cloudflare.F("string"),
CustomNonIdentityDenyURL: cloudflare.F("string"),
CustomPages: cloudflare.F([]string{"699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252"}),
Domain: cloudflare.F("test.example.com/admin"),
EnableBindingCookie: cloudflare.F(true),
HTTPOnlyCookieAttribute: cloudflare.F(true),
LogoURL: cloudflare.F("https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg"),
Expand All @@ -191,7 +192,6 @@ func TestAccessAppAccessApplicationsAddAnApplicationWithOptionalParams(t *testin
SessionDuration: cloudflare.F("24h"),
SkipInterstitial: cloudflare.F(true),
Tags: cloudflare.F([]string{"engineers", "engineers", "engineers"}),
Type: cloudflare.F("self_hosted"),
},
)
if err != nil {
Expand Down
91 changes: 63 additions & 28 deletions accessappca.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import (
"context"
"fmt"
"net/http"
"reflect"

"github.com/cloudflare/cloudflare-sdk-go/internal/apijson"
"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"
)

// AccessAppCaService contains methods and other services that help with
Expand Down Expand Up @@ -100,9 +103,41 @@ func (r *AccessAppCaDeleteResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

type AccessAppCaAccessShortLivedCertificateCAsNewAShortLivedCertificateCaResponse = interface{}
// Union satisfied by
// [AccessAppCaAccessShortLivedCertificateCAsNewAShortLivedCertificateCaResponseUnknown]
// or [shared.UnionString].
type AccessAppCaAccessShortLivedCertificateCAsNewAShortLivedCertificateCaResponse interface {
ImplementsAccessAppCaAccessShortLivedCertificateCAsNewAShortLivedCertificateCaResponse()
}

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

type AccessAppCaAccessShortLivedCertificateCAsGetAShortLivedCertificateCaResponse = interface{}
// Union satisfied by
// [AccessAppCaAccessShortLivedCertificateCAsGetAShortLivedCertificateCaResponseUnknown]
// or [shared.UnionString].
type AccessAppCaAccessShortLivedCertificateCAsGetAShortLivedCertificateCaResponse interface {
ImplementsAccessAppCaAccessShortLivedCertificateCAsGetAShortLivedCertificateCaResponse()
}

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

type AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponse struct {
// The ID of the CA.
Expand Down Expand Up @@ -131,11 +166,11 @@ func (r *AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsRe
}

type AccessAppCaDeleteResponseEnvelope struct {
Errors []AccessAppCaDeleteResponseEnvelopeErrors `json:"errors"`
Messages []AccessAppCaDeleteResponseEnvelopeMessages `json:"messages"`
Result AccessAppCaDeleteResponse `json:"result"`
Errors []AccessAppCaDeleteResponseEnvelopeErrors `json:"errors,required"`
Messages []AccessAppCaDeleteResponseEnvelopeMessages `json:"messages,required"`
Result AccessAppCaDeleteResponse `json:"result,required"`
// Whether the API call was successful
Success AccessAppCaDeleteResponseEnvelopeSuccess `json:"success"`
Success AccessAppCaDeleteResponseEnvelopeSuccess `json:"success,required"`
JSON accessAppCaDeleteResponseEnvelopeJSON `json:"-"`
}

Expand Down Expand Up @@ -200,11 +235,11 @@ const (
)

type AccessAppCaAccessShortLivedCertificateCAsNewAShortLivedCertificateCaResponseEnvelope struct {
Errors []AccessAppCaAccessShortLivedCertificateCAsNewAShortLivedCertificateCaResponseEnvelopeErrors `json:"errors"`
Messages []AccessAppCaAccessShortLivedCertificateCAsNewAShortLivedCertificateCaResponseEnvelopeMessages `json:"messages"`
Result AccessAppCaAccessShortLivedCertificateCAsNewAShortLivedCertificateCaResponse `json:"result"`
Errors []AccessAppCaAccessShortLivedCertificateCAsNewAShortLivedCertificateCaResponseEnvelopeErrors `json:"errors,required"`
Messages []AccessAppCaAccessShortLivedCertificateCAsNewAShortLivedCertificateCaResponseEnvelopeMessages `json:"messages,required"`
Result AccessAppCaAccessShortLivedCertificateCAsNewAShortLivedCertificateCaResponse `json:"result,required"`
// Whether the API call was successful
Success AccessAppCaAccessShortLivedCertificateCAsNewAShortLivedCertificateCaResponseEnvelopeSuccess `json:"success"`
Success AccessAppCaAccessShortLivedCertificateCAsNewAShortLivedCertificateCaResponseEnvelopeSuccess `json:"success,required"`
JSON accessAppCaAccessShortLivedCertificateCAsNewAShortLivedCertificateCaResponseEnvelopeJSON `json:"-"`
}

Expand Down Expand Up @@ -272,11 +307,11 @@ const (
)

type AccessAppCaAccessShortLivedCertificateCAsGetAShortLivedCertificateCaResponseEnvelope struct {
Errors []AccessAppCaAccessShortLivedCertificateCAsGetAShortLivedCertificateCaResponseEnvelopeErrors `json:"errors"`
Messages []AccessAppCaAccessShortLivedCertificateCAsGetAShortLivedCertificateCaResponseEnvelopeMessages `json:"messages"`
Result AccessAppCaAccessShortLivedCertificateCAsGetAShortLivedCertificateCaResponse `json:"result"`
Errors []AccessAppCaAccessShortLivedCertificateCAsGetAShortLivedCertificateCaResponseEnvelopeErrors `json:"errors,required"`
Messages []AccessAppCaAccessShortLivedCertificateCAsGetAShortLivedCertificateCaResponseEnvelopeMessages `json:"messages,required"`
Result AccessAppCaAccessShortLivedCertificateCAsGetAShortLivedCertificateCaResponse `json:"result,required"`
// Whether the API call was successful
Success AccessAppCaAccessShortLivedCertificateCAsGetAShortLivedCertificateCaResponseEnvelopeSuccess `json:"success"`
Success AccessAppCaAccessShortLivedCertificateCAsGetAShortLivedCertificateCaResponseEnvelopeSuccess `json:"success,required"`
JSON accessAppCaAccessShortLivedCertificateCAsGetAShortLivedCertificateCaResponseEnvelopeJSON `json:"-"`
}

Expand Down Expand Up @@ -344,13 +379,13 @@ const (
)

type AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelope struct {
Errors []AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeErrors `json:"errors"`
Messages []AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeMessages `json:"messages"`
Result []AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponse `json:"result"`
ResultInfo AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeResultInfo `json:"result_info"`
Errors []AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeErrors `json:"errors,required"`
Messages []AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeMessages `json:"messages,required"`
Result []AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponse `json:"result,required,nullable"`
// Whether the API call was successful
Success AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeSuccess `json:"success"`
JSON accessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeJSON `json:"-"`
Success AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeSuccess `json:"success,required"`
ResultInfo AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeResultInfo `json:"result_info"`
JSON accessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeJSON `json:"-"`
}

// accessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeJSON
Expand All @@ -360,8 +395,8 @@ type accessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsRespon
Errors apijson.Field
Messages apijson.Field
Result apijson.Field
ResultInfo apijson.Field
Success apijson.Field
ResultInfo apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand Down Expand Up @@ -410,6 +445,13 @@ func (r *AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsRe
return apijson.UnmarshalRoot(data, r)
}

// Whether the API call was successful
type AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeSuccess bool

const (
AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeSuccessTrue AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeSuccess = true
)

type AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeResultInfo struct {
// Total number of results for the requested service
Count float64 `json:"count"`
Expand Down Expand Up @@ -437,10 +479,3 @@ type accessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsRespon
func (r *AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

// Whether the API call was successful
type AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeSuccess bool

const (
AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeSuccessTrue AccessAppCaAccessShortLivedCertificateCAsListShortLivedCertificateCAsResponseEnvelopeSuccess = true
)
60 changes: 30 additions & 30 deletions accessapppolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -9743,11 +9743,11 @@ func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseRequireAccessDev
}

type AccessAppPolicyGetResponseEnvelope struct {
Errors []AccessAppPolicyGetResponseEnvelopeErrors `json:"errors"`
Messages []AccessAppPolicyGetResponseEnvelopeMessages `json:"messages"`
Result AccessAppPolicyGetResponse `json:"result"`
Errors []AccessAppPolicyGetResponseEnvelopeErrors `json:"errors,required"`
Messages []AccessAppPolicyGetResponseEnvelopeMessages `json:"messages,required"`
Result AccessAppPolicyGetResponse `json:"result,required"`
// Whether the API call was successful
Success AccessAppPolicyGetResponseEnvelopeSuccess `json:"success"`
Success AccessAppPolicyGetResponseEnvelopeSuccess `json:"success,required"`
JSON accessAppPolicyGetResponseEnvelopeJSON `json:"-"`
}

Expand Down Expand Up @@ -11114,11 +11114,11 @@ func (r AccessAppPolicyUpdateParamsRequireAccessDevicePostureRuleDevicePosture)
}

type AccessAppPolicyUpdateResponseEnvelope struct {
Errors []AccessAppPolicyUpdateResponseEnvelopeErrors `json:"errors"`
Messages []AccessAppPolicyUpdateResponseEnvelopeMessages `json:"messages"`
Result AccessAppPolicyUpdateResponse `json:"result"`
Errors []AccessAppPolicyUpdateResponseEnvelopeErrors `json:"errors,required"`
Messages []AccessAppPolicyUpdateResponseEnvelopeMessages `json:"messages,required"`
Result AccessAppPolicyUpdateResponse `json:"result,required"`
// Whether the API call was successful
Success AccessAppPolicyUpdateResponseEnvelopeSuccess `json:"success"`
Success AccessAppPolicyUpdateResponseEnvelopeSuccess `json:"success,required"`
JSON accessAppPolicyUpdateResponseEnvelopeJSON `json:"-"`
}

Expand Down Expand Up @@ -11183,11 +11183,11 @@ const (
)

type AccessAppPolicyDeleteResponseEnvelope struct {
Errors []AccessAppPolicyDeleteResponseEnvelopeErrors `json:"errors"`
Messages []AccessAppPolicyDeleteResponseEnvelopeMessages `json:"messages"`
Result AccessAppPolicyDeleteResponse `json:"result"`
Errors []AccessAppPolicyDeleteResponseEnvelopeErrors `json:"errors,required"`
Messages []AccessAppPolicyDeleteResponseEnvelopeMessages `json:"messages,required"`
Result AccessAppPolicyDeleteResponse `json:"result,required"`
// Whether the API call was successful
Success AccessAppPolicyDeleteResponseEnvelopeSuccess `json:"success"`
Success AccessAppPolicyDeleteResponseEnvelopeSuccess `json:"success,required"`
JSON accessAppPolicyDeleteResponseEnvelopeJSON `json:"-"`
}

Expand Down Expand Up @@ -12557,11 +12557,11 @@ func (r AccessAppPolicyAccessPoliciesNewAnAccessPolicyParamsRequireAccessDeviceP
}

type AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelope struct {
Errors []AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeErrors `json:"errors"`
Messages []AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeMessages `json:"messages"`
Result AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponse `json:"result"`
Errors []AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeErrors `json:"errors,required"`
Messages []AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeMessages `json:"messages,required"`
Result AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponse `json:"result,required"`
// Whether the API call was successful
Success AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeSuccess `json:"success"`
Success AccessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeSuccess `json:"success,required"`
JSON accessAppPolicyAccessPoliciesNewAnAccessPolicyResponseEnvelopeJSON `json:"-"`
}

Expand Down Expand Up @@ -12629,13 +12629,13 @@ const (
)

type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelope struct {
Errors []AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeErrors `json:"errors"`
Messages []AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeMessages `json:"messages"`
Result []AccessAppPolicyAccessPoliciesListAccessPoliciesResponse `json:"result"`
ResultInfo AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeResultInfo `json:"result_info"`
Errors []AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeErrors `json:"errors,required"`
Messages []AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeMessages `json:"messages,required"`
Result []AccessAppPolicyAccessPoliciesListAccessPoliciesResponse `json:"result,required,nullable"`
// Whether the API call was successful
Success AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeSuccess `json:"success"`
JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeJSON `json:"-"`
Success AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeSuccess `json:"success,required"`
ResultInfo AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeResultInfo `json:"result_info"`
JSON accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeJSON `json:"-"`
}

// accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeJSON contains the
Expand All @@ -12645,8 +12645,8 @@ type accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeJSON struct
Errors apijson.Field
Messages apijson.Field
Result apijson.Field
ResultInfo apijson.Field
Success apijson.Field
ResultInfo apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand Down Expand Up @@ -12695,6 +12695,13 @@ func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeMessages
return apijson.UnmarshalRoot(data, r)
}

// Whether the API call was successful
type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeSuccess bool

const (
AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeSuccessTrue AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeSuccess = true
)

type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeResultInfo struct {
// Total number of results for the requested service
Count float64 `json:"count"`
Expand Down Expand Up @@ -12722,10 +12729,3 @@ type accessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeResultInfoJS
func (r *AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

// Whether the API call was successful
type AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeSuccess bool

const (
AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeSuccessTrue AccessAppPolicyAccessPoliciesListAccessPoliciesResponseEnvelopeSuccess = true
)
Loading

0 comments on commit a4988d1

Please sign in to comment.