From 74b222e043e86e6b9067062ec47d083a66c10b08 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 21 Mar 2024 04:34:20 +0000 Subject: [PATCH] feat(api): update via SDK Studio --- zero_trust/accessapplication.go | 40 ++++++++++++------------ zero_trust/accessapplication_test.go | 8 ++--- zero_trust/accessuseractivesession.go | 18 +++++------ zero_trust/accessuserlastseenidentity.go | 18 +++++------ zero_trust/identityprovider.go | 12 +++---- zero_trust/identityprovider_test.go | 4 +-- 6 files changed, 50 insertions(+), 50 deletions(-) diff --git a/zero_trust/accessapplication.go b/zero_trust/accessapplication.go index a43bde739da..17e303bd04a 100644 --- a/zero_trust/accessapplication.go +++ b/zero_trust/accessapplication.go @@ -238,7 +238,7 @@ type AccessAppsSelfHostedApplication struct { AllowAuthenticateViaWARP bool `json:"allow_authenticate_via_warp"` // The identity providers your users can select when connecting to this // application. Defaults to all IdPs configured in your account. - AllowedIdps []string `json:"allowed_idps"` + AllowedIDPs []string `json:"allowed_idps"` // Displays the application in the App Launcher. AppLauncherVisible bool `json:"app_launcher_visible"` // Audience tag. @@ -299,7 +299,7 @@ type accessAppsSelfHostedApplicationJSON struct { Type apijson.Field ID apijson.Field AllowAuthenticateViaWARP apijson.Field - AllowedIdps apijson.Field + AllowedIDPs apijson.Field AppLauncherVisible apijson.Field Aud apijson.Field AutoRedirectToIdentity apijson.Field @@ -406,7 +406,7 @@ type AccessAppsSaaSApplication struct { ID string `json:"id"` // The identity providers your users can select when connecting to this // application. Defaults to all IdPs configured in your account. - AllowedIdps []string `json:"allowed_idps"` + AllowedIDPs []string `json:"allowed_idps"` // Displays the application in the App Launcher. AppLauncherVisible bool `json:"app_launcher_visible"` // Audience tag. @@ -435,7 +435,7 @@ type AccessAppsSaaSApplication struct { // [AccessAppsSaaSApplication] type accessAppsSaaSApplicationJSON struct { ID apijson.Field - AllowedIdps apijson.Field + AllowedIDPs apijson.Field AppLauncherVisible apijson.Field Aud apijson.Field AutoRedirectToIdentity apijson.Field @@ -496,7 +496,7 @@ type AccessAppsSaaSApplicationSaasAppAccessSamlSaasApp struct { // initiated logins. DefaultRelayState string `json:"default_relay_state"` // The unique identifier for your SaaS application. - IdpEntityID string `json:"idp_entity_id"` + IDPEntityID string `json:"idp_entity_id"` // The format of the name identifier sent to the SaaS application. NameIDFormat AccessAppsSaaSApplicationSaasAppAccessSamlSaasAppNameIDFormat `json:"name_id_format"` // A [JSONata](https://jsonata.org/) expression that transforms an application's @@ -522,7 +522,7 @@ type accessAppsSaaSApplicationSaasAppAccessSamlSaasAppJSON struct { CreatedAt apijson.Field CustomAttributes apijson.Field DefaultRelayState apijson.Field - IdpEntityID apijson.Field + IDPEntityID apijson.Field NameIDFormat apijson.Field NameIDTransformJsonata apijson.Field PublicKey apijson.Field @@ -764,7 +764,7 @@ type AccessAppsBrowserSSHApplication struct { AllowAuthenticateViaWARP bool `json:"allow_authenticate_via_warp"` // The identity providers your users can select when connecting to this // application. Defaults to all IdPs configured in your account. - AllowedIdps []string `json:"allowed_idps"` + AllowedIDPs []string `json:"allowed_idps"` // Displays the application in the App Launcher. AppLauncherVisible bool `json:"app_launcher_visible"` // Audience tag. @@ -825,7 +825,7 @@ type accessAppsBrowserSSHApplicationJSON struct { Type apijson.Field ID apijson.Field AllowAuthenticateViaWARP apijson.Field - AllowedIdps apijson.Field + AllowedIDPs apijson.Field AppLauncherVisible apijson.Field Aud apijson.Field AutoRedirectToIdentity apijson.Field @@ -942,7 +942,7 @@ type AccessAppsBrowserVncApplication struct { AllowAuthenticateViaWARP bool `json:"allow_authenticate_via_warp"` // The identity providers your users can select when connecting to this // application. Defaults to all IdPs configured in your account. - AllowedIdps []string `json:"allowed_idps"` + AllowedIDPs []string `json:"allowed_idps"` // Displays the application in the App Launcher. AppLauncherVisible bool `json:"app_launcher_visible"` // Audience tag. @@ -1003,7 +1003,7 @@ type accessAppsBrowserVncApplicationJSON struct { Type apijson.Field ID apijson.Field AllowAuthenticateViaWARP apijson.Field - AllowedIdps apijson.Field + AllowedIDPs apijson.Field AppLauncherVisible apijson.Field Aud apijson.Field AutoRedirectToIdentity apijson.Field @@ -1112,7 +1112,7 @@ type AccessAppsAppLauncherApplication struct { ID string `json:"id"` // The identity providers your users can select when connecting to this // application. Defaults to all IdPs configured in your account. - AllowedIdps []string `json:"allowed_idps"` + AllowedIDPs []string `json:"allowed_idps"` // Audience tag. Aud string `json:"aud"` // When set to `true`, users skip the identity provider selection step during @@ -1137,7 +1137,7 @@ type AccessAppsAppLauncherApplication struct { type accessAppsAppLauncherApplicationJSON struct { Type apijson.Field ID apijson.Field - AllowedIdps apijson.Field + AllowedIDPs apijson.Field Aud apijson.Field AutoRedirectToIdentity apijson.Field CreatedAt apijson.Field @@ -1189,7 +1189,7 @@ type AccessAppsDeviceEnrollmentPermissionsApplication struct { ID string `json:"id"` // The identity providers your users can select when connecting to this // application. Defaults to all IdPs configured in your account. - AllowedIdps []string `json:"allowed_idps"` + AllowedIDPs []string `json:"allowed_idps"` // Audience tag. Aud string `json:"aud"` // When set to `true`, users skip the identity provider selection step during @@ -1214,7 +1214,7 @@ type AccessAppsDeviceEnrollmentPermissionsApplication struct { type accessAppsDeviceEnrollmentPermissionsApplicationJSON struct { Type apijson.Field ID apijson.Field - AllowedIdps apijson.Field + AllowedIDPs apijson.Field Aud apijson.Field AutoRedirectToIdentity apijson.Field CreatedAt apijson.Field @@ -1266,7 +1266,7 @@ type AccessAppsBrowserIsolationPermissionsApplication struct { ID string `json:"id"` // The identity providers your users can select when connecting to this // application. Defaults to all IdPs configured in your account. - AllowedIdps []string `json:"allowed_idps"` + AllowedIDPs []string `json:"allowed_idps"` // Audience tag. Aud string `json:"aud"` // When set to `true`, users skip the identity provider selection step during @@ -1291,7 +1291,7 @@ type AccessAppsBrowserIsolationPermissionsApplication struct { type accessAppsBrowserIsolationPermissionsApplicationJSON struct { Type apijson.Field ID apijson.Field - AllowedIdps apijson.Field + AllowedIDPs apijson.Field Aud apijson.Field AutoRedirectToIdentity apijson.Field CreatedAt apijson.Field @@ -1421,7 +1421,7 @@ type AccessApplicationNewParams struct { AllowAuthenticateViaWARP param.Field[bool] `json:"allow_authenticate_via_warp"` // The identity providers your users can select when connecting to this // application. Defaults to all IdPs configured in your account. - AllowedIdps param.Field[[]string] `json:"allowed_idps"` + AllowedIDPs param.Field[[]string] `json:"allowed_idps"` AppLauncherVisible param.Field[interface{}] `json:"app_launcher_visible"` // When set to `true`, users skip the identity provider selection step during // login. You must specify only one identity provider in allowed_idps. @@ -1542,7 +1542,7 @@ type AccessApplicationNewParamsSaasAppAccessSamlSaasApp struct { // initiated logins. DefaultRelayState param.Field[string] `json:"default_relay_state"` // The unique identifier for your SaaS application. - IdpEntityID param.Field[string] `json:"idp_entity_id"` + IDPEntityID param.Field[string] `json:"idp_entity_id"` // The format of the name identifier sent to the SaaS application. NameIDFormat param.Field[AccessApplicationNewParamsSaasAppAccessSamlSaasAppNameIDFormat] `json:"name_id_format"` // A [JSONata](https://jsonata.org/) expression that transforms an application's @@ -1839,7 +1839,7 @@ type AccessApplicationUpdateParams struct { AllowAuthenticateViaWARP param.Field[bool] `json:"allow_authenticate_via_warp"` // The identity providers your users can select when connecting to this // application. Defaults to all IdPs configured in your account. - AllowedIdps param.Field[[]string] `json:"allowed_idps"` + AllowedIDPs param.Field[[]string] `json:"allowed_idps"` AppLauncherVisible param.Field[interface{}] `json:"app_launcher_visible"` // When set to `true`, users skip the identity provider selection step during // login. You must specify only one identity provider in allowed_idps. @@ -1967,7 +1967,7 @@ type AccessApplicationUpdateParamsSaasAppAccessSamlSaasApp struct { // initiated logins. DefaultRelayState param.Field[string] `json:"default_relay_state"` // The unique identifier for your SaaS application. - IdpEntityID param.Field[string] `json:"idp_entity_id"` + IDPEntityID param.Field[string] `json:"idp_entity_id"` // The format of the name identifier sent to the SaaS application. NameIDFormat param.Field[AccessApplicationUpdateParamsSaasAppAccessSamlSaasAppNameIDFormat] `json:"name_id_format"` // A [JSONata](https://jsonata.org/) expression that transforms an application's diff --git a/zero_trust/accessapplication_test.go b/zero_trust/accessapplication_test.go index a786bfbfa4f..0de70898158 100644 --- a/zero_trust/accessapplication_test.go +++ b/zero_trust/accessapplication_test.go @@ -33,7 +33,7 @@ func TestAccessApplicationNewWithOptionalParams(t *testing.T) { AccountID: cloudflare.F("string"), ZoneID: cloudflare.F("string"), AllowAuthenticateViaWARP: cloudflare.F(true), - AllowedIdps: cloudflare.F([]string{"699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252"}), + AllowedIDPs: cloudflare.F([]string{"699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252"}), AppLauncherVisible: cloudflare.F[any](map[string]interface{}{}), AutoRedirectToIdentity: cloudflare.F(true), CorsHeaders: cloudflare.F(zero_trust.AccessApplicationNewParamsCorsHeaders{ @@ -67,7 +67,7 @@ func TestAccessApplicationNewWithOptionalParams(t *testing.T) { }), }), DefaultRelayState: cloudflare.F("https://example.com"), - IdpEntityID: cloudflare.F("https://example.cloudflareaccess.com"), + IDPEntityID: cloudflare.F("https://example.cloudflareaccess.com"), NameIDFormat: cloudflare.F(zero_trust.AccessApplicationNewParamsSaasAppAccessSamlSaasAppNameIDFormatID), NameIDTransformJsonata: cloudflare.F("$substringBefore(email, '@') & '+sandbox@' & $substringAfter(email, '@')"), PublicKey: cloudflare.F("example unique name"), @@ -112,7 +112,7 @@ func TestAccessApplicationUpdateWithOptionalParams(t *testing.T) { AccountID: cloudflare.F("string"), ZoneID: cloudflare.F("string"), AllowAuthenticateViaWARP: cloudflare.F(true), - AllowedIdps: cloudflare.F([]string{"699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252"}), + AllowedIDPs: cloudflare.F([]string{"699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252"}), AppLauncherVisible: cloudflare.F[any](map[string]interface{}{}), AutoRedirectToIdentity: cloudflare.F(true), CorsHeaders: cloudflare.F(zero_trust.AccessApplicationUpdateParamsCorsHeaders{ @@ -146,7 +146,7 @@ func TestAccessApplicationUpdateWithOptionalParams(t *testing.T) { }), }), DefaultRelayState: cloudflare.F("https://example.com"), - IdpEntityID: cloudflare.F("https://example.cloudflareaccess.com"), + IDPEntityID: cloudflare.F("https://example.cloudflareaccess.com"), NameIDFormat: cloudflare.F(zero_trust.AccessApplicationUpdateParamsSaasAppAccessSamlSaasAppNameIDFormatID), NameIDTransformJsonata: cloudflare.F("$substringBefore(email, '@') & '+sandbox@' & $substringAfter(email, '@')"), PublicKey: cloudflare.F("example unique name"), diff --git a/zero_trust/accessuseractivesession.go b/zero_trust/accessuseractivesession.go index c4817ad2c26..fce387093b3 100644 --- a/zero_trust/accessuseractivesession.go +++ b/zero_trust/accessuseractivesession.go @@ -147,7 +147,7 @@ type AccessUserActiveSessionGetResponse struct { Email string `json:"email"` Geo AccessUserActiveSessionGetResponseGeo `json:"geo"` Iat float64 `json:"iat"` - Idp AccessUserActiveSessionGetResponseIdp `json:"idp"` + IDP AccessUserActiveSessionGetResponseIDP `json:"idp"` IP string `json:"ip"` IsGateway bool `json:"is_gateway"` IsWARP bool `json:"is_warp"` @@ -172,7 +172,7 @@ type accessUserActiveSessionGetResponseJSON struct { Email apijson.Field Geo apijson.Field Iat apijson.Field - Idp apijson.Field + IDP apijson.Field IP apijson.Field IsGateway apijson.Field IsWARP apijson.Field @@ -296,26 +296,26 @@ func (r accessUserActiveSessionGetResponseGeoJSON) RawJSON() string { return r.raw } -type AccessUserActiveSessionGetResponseIdp struct { +type AccessUserActiveSessionGetResponseIDP struct { ID string `json:"id"` Type string `json:"type"` - JSON accessUserActiveSessionGetResponseIdpJSON `json:"-"` + JSON accessUserActiveSessionGetResponseIDPJSON `json:"-"` } -// accessUserActiveSessionGetResponseIdpJSON contains the JSON metadata for the -// struct [AccessUserActiveSessionGetResponseIdp] -type accessUserActiveSessionGetResponseIdpJSON struct { +// accessUserActiveSessionGetResponseIDPJSON contains the JSON metadata for the +// struct [AccessUserActiveSessionGetResponseIDP] +type accessUserActiveSessionGetResponseIDPJSON struct { ID apijson.Field Type apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessUserActiveSessionGetResponseIdp) UnmarshalJSON(data []byte) (err error) { +func (r *AccessUserActiveSessionGetResponseIDP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r accessUserActiveSessionGetResponseIdpJSON) RawJSON() string { +func (r accessUserActiveSessionGetResponseIDPJSON) RawJSON() string { return r.raw } diff --git a/zero_trust/accessuserlastseenidentity.go b/zero_trust/accessuserlastseenidentity.go index 1517232e36e..5250d4d9ee4 100644 --- a/zero_trust/accessuserlastseenidentity.go +++ b/zero_trust/accessuserlastseenidentity.go @@ -53,7 +53,7 @@ type AccessIdentity struct { Email string `json:"email"` Geo AccessIdentityGeo `json:"geo"` Iat float64 `json:"iat"` - Idp AccessIdentityIdp `json:"idp"` + IDP AccessIdentityIDP `json:"idp"` IP string `json:"ip"` IsGateway bool `json:"is_gateway"` IsWARP bool `json:"is_warp"` @@ -76,7 +76,7 @@ type accessIdentityJSON struct { Email apijson.Field Geo apijson.Field Iat apijson.Field - Idp apijson.Field + IDP apijson.Field IP apijson.Field IsGateway apijson.Field IsWARP apijson.Field @@ -199,26 +199,26 @@ func (r accessIdentityGeoJSON) RawJSON() string { return r.raw } -type AccessIdentityIdp struct { +type AccessIdentityIDP struct { ID string `json:"id"` Type string `json:"type"` - JSON accessIdentityIdpJSON `json:"-"` + JSON accessIdentityIDPJSON `json:"-"` } -// accessIdentityIdpJSON contains the JSON metadata for the struct -// [AccessIdentityIdp] -type accessIdentityIdpJSON struct { +// accessIdentityIDPJSON contains the JSON metadata for the struct +// [AccessIdentityIDP] +type accessIdentityIDPJSON struct { ID apijson.Field Type apijson.Field raw string ExtraFields map[string]apijson.Field } -func (r *AccessIdentityIdp) UnmarshalJSON(data []byte) (err error) { +func (r *AccessIdentityIDP) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } -func (r accessIdentityIdpJSON) RawJSON() string { +func (r accessIdentityIDPJSON) RawJSON() string { return r.raw } diff --git a/zero_trust/identityprovider.go b/zero_trust/identityprovider.go index 30e4c9d3027..72e72c7ef23 100644 --- a/zero_trust/identityprovider.go +++ b/zero_trust/identityprovider.go @@ -1964,7 +1964,7 @@ type AccessIdentityProvidersAccessSamlConfig struct { // the Access callback. HeaderAttributes []AccessIdentityProvidersAccessSamlConfigHeaderAttribute `json:"header_attributes"` // X509 certificate to verify the signature in the SAML authentication response - IdpPublicCERTs []string `json:"idp_public_certs"` + IDPPublicCERTs []string `json:"idp_public_certs"` // IdP Entity ID or Issuer URL IssuerURL string `json:"issuer_url"` // Sign the SAML authentication request with Access credentials. To verify the @@ -1981,7 +1981,7 @@ type accessIdentityProvidersAccessSamlConfigJSON struct { Attributes apijson.Field EmailAttributeName apijson.Field HeaderAttributes apijson.Field - IdpPublicCERTs apijson.Field + IDPPublicCERTs apijson.Field IssuerURL apijson.Field SignRequest apijson.Field SSOTargetURL apijson.Field @@ -4174,7 +4174,7 @@ type IdentityProviderListResponseAccessSamlConfig struct { // the Access callback. HeaderAttributes []IdentityProviderListResponseAccessSamlConfigHeaderAttribute `json:"header_attributes"` // X509 certificate to verify the signature in the SAML authentication response - IdpPublicCERTs []string `json:"idp_public_certs"` + IDPPublicCERTs []string `json:"idp_public_certs"` // IdP Entity ID or Issuer URL IssuerURL string `json:"issuer_url"` // Sign the SAML authentication request with Access credentials. To verify the @@ -4191,7 +4191,7 @@ type identityProviderListResponseAccessSamlConfigJSON struct { Attributes apijson.Field EmailAttributeName apijson.Field HeaderAttributes apijson.Field - IdpPublicCERTs apijson.Field + IDPPublicCERTs apijson.Field IssuerURL apijson.Field SignRequest apijson.Field SSOTargetURL apijson.Field @@ -4523,7 +4523,7 @@ type IdentityProviderNewParamsConfig struct { // the Access callback. HeaderAttributes param.Field[[]IdentityProviderNewParamsConfigHeaderAttribute] `json:"header_attributes"` // X509 certificate to verify the signature in the SAML authentication response - IdpPublicCERTs param.Field[[]string] `json:"idp_public_certs"` + IDPPublicCERTs param.Field[[]string] `json:"idp_public_certs"` // IdP Entity ID or Issuer URL IssuerURL param.Field[string] `json:"issuer_url"` // Your okta account url @@ -4789,7 +4789,7 @@ type IdentityProviderUpdateParamsConfig struct { // the Access callback. HeaderAttributes param.Field[[]IdentityProviderUpdateParamsConfigHeaderAttribute] `json:"header_attributes"` // X509 certificate to verify the signature in the SAML authentication response - IdpPublicCERTs param.Field[[]string] `json:"idp_public_certs"` + IDPPublicCERTs param.Field[[]string] `json:"idp_public_certs"` // IdP Entity ID or Issuer URL IssuerURL param.Field[string] `json:"issuer_url"` // Your okta account url diff --git a/zero_trust/identityprovider_test.go b/zero_trust/identityprovider_test.go index 055281ff638..4cc03b41eba 100644 --- a/zero_trust/identityprovider_test.go +++ b/zero_trust/identityprovider_test.go @@ -61,7 +61,7 @@ func TestIdentityProviderNewWithOptionalParams(t *testing.T) { AttributeName: cloudflare.F("string"), HeaderName: cloudflare.F("string"), }}), - IdpPublicCERTs: cloudflare.F([]string{"string", "string", "string"}), + IDPPublicCERTs: cloudflare.F([]string{"string", "string", "string"}), IssuerURL: cloudflare.F("https://whoami.com"), SignRequest: cloudflare.F(true), SSOTargetURL: cloudflare.F("https://edgeaccess.org/idp/saml/login"), @@ -137,7 +137,7 @@ func TestIdentityProviderUpdateWithOptionalParams(t *testing.T) { AttributeName: cloudflare.F("string"), HeaderName: cloudflare.F("string"), }}), - IdpPublicCERTs: cloudflare.F([]string{"string", "string", "string"}), + IDPPublicCERTs: cloudflare.F([]string{"string", "string", "string"}), IssuerURL: cloudflare.F("https://whoami.com"), SignRequest: cloudflare.F(true), SSOTargetURL: cloudflare.F("https://edgeaccess.org/idp/saml/login"),